Why ExecuteNonQuery() returns -1

Why ExecuteNonQuery() returns -1


Check that you don't have "SET NOCOUNT ON" in your stored procedure. This will stop the number of affect rows be returned. Default response will always be '-1' in this situation.
Change it to "OFF"
Seyed Hamed Vahedi Seyed Hamed Vahedi     Fri, 14 October, 2022